1. What is Image Filtering?
Image Filtering is a neighbourhood-based processing technique where a pixel is modified using information from surrounding pixels.
Unlike point-based processing, filtering uses neighbouring pixels to determine the new value.
๐ง Memory Trick:
Point Processing = Pixel โ Pixel
Filtering = Neighbourhood โ Pixel
2. Why Do We Use Filtering?
- Reduce noise
- Smooth images
- Sharpen details
- Enhance image quality
- Prepare images for later processing
Exam Keyword:
Neighbourhood Processing
3. Common Types of Noise
| Noise Type |
Description |
| Salt & Pepper Noise |
Random black and white pixels |
| Impulse Noise |
Random bright pixels |
| Gaussian Noise |
Intensity variations following a normal distribution |
๐ง Remember:
Salt & Pepper = Isolated extreme pixels
Gaussian = Continuous random variation
4. Neighbourhood Processing
Modify a pixel using surrounding pixels within a small window (mask/filter).
Example:
A 3ร3 filter uses 9 pixels to compute one output pixel.
The filter slides across the entire image.
5. Moving Average Filter
Replace each pixel with the average of neighbouring pixels.
Example Kernel:
[1 1 1]
[1 1 1] รท 9
[1 1 1]
Produces smoothing and noise reduction.
Exam Keyword:
Averaging Filter / Box Filter
6. Weighted Moving Average
Nearby pixels contribute more than distant pixels.
Example:
[1 4 6 4 1] รท 16
๐ง Remember:
Not all neighbours are equally important.
7. Correlation Filtering
Apply the filter directly on the image without changing the kernel orientation.
Each filter value acts as a weight for its corresponding neighbour.
๐ง Shortcut:
Correlation = Direct Application
8. Boundary Problem
Filters extend beyond image borders near edges.
| Padding Method |
Description |
| Zero Padding |
Fill outside area with 0 |
| Wrap Around |
Use pixels from opposite side |
| Copy Edge |
Repeat border pixels |
9. Gaussian Filter
A weighted smoothing filter where centre pixels receive larger weights.
Produces smoother results while preserving more details than a simple average filter.
Important Parameter:
ฯ (Sigma)
๐ง Sigma Rule:
Larger ฯ โ More Blur
Smaller ฯ โ Less Blur
10. Properties of Smoothing Filters
- Filter values are positive
- Kernel weights sum to 1
- Reduce high-frequency components
- Perform low-pass filtering
Smoothing reduces noise but may remove fine details.
11. Convolution
Convolution flips the kernel horizontally and vertically before filtering.
Steps:
- Flip kernel
- Apply correlation process
- Store result
๐ง Memory Trick:
Convolution = Flip + Correlation
12. Correlation vs Convolution
| Correlation |
Convolution |
| Kernel not flipped |
Kernel flipped |
| Direct filtering |
Flip then filter |
| Easier to understand |
Important in signal processing |
Special Rule:
Symmetric Kernel โ Correlation = Convolution
13. Filter Separability
Some filters can be split into horizontal and vertical operations.
Reduces computational cost significantly.
๐ง Exam Point:
Gaussian Filter is separable.
14. Image Sharpening
Sharpening enhances edges and local intensity differences.
Opposite goal of smoothing.
๐ง Remember:
Smoothing removes details.
Sharpening restores details.
15. Unsharp Masking
One of the most common sharpening techniques.
| Step |
Formula |
| Extract Details |
Original โ Smoothed |
| Sharpen Image |
Original + Details |
Exam Formula:
Details = Original โ Smoothed
Sharpened = Original + Details
16. Median Filter
Replaces a pixel with the median value of neighbouring pixels.
Removes outliers without introducing new pixel values.
Best For:
Salt & Pepper Noise
๐ง Median ignores extreme values naturally.
17. Multi-Stage Median Filter
Combines multiple median filters from different neighbourhoods.
Preserves corners and important image structures better than a standard median filter.
18. Alpha-Trimmed Mean Filter
Hybrid filter between averaging and median filtering.
Procedure:
- Sort neighbourhood values
- Remove ฮฑ/2 smallest values
- Remove ฮฑ/2 largest values
- Average remaining values
Reduces effect of extreme outliers while still using averaging.
๐ง Think:
Average + Median = Alpha-Trimmed Mean
19. Filter Comparison
| Filter |
Strength |
Weakness |
| Average Filter |
Simple smoothing |
Blurry output |
| Gaussian Filter |
Better smoothing |
Still causes blur |
| Median Filter |
Excellent for impulse noise |
May remove fine details |
| Alpha-Trimmed Mean |
Balances averaging and median |
Requires parameter tuning |
20. Final Exam Summary
Most Important Points
- Filtering: Uses neighbouring pixels.
- Moving Average: Average of neighbours.
- Gaussian Filter: Weighted smoothing using ฯ.
- Correlation: Apply kernel directly.
- Convolution: Flip kernel first.
- Special Rule: Symmetric kernel โ Correlation = Convolution.
- Separability: Gaussian filter is separable.
- Sharpening: Enhance edges and details.
- Unsharp Masking: Original + (Original โ Smoothed).
- Median Filter: Best for Salt & Pepper Noise.
- Alpha-Trimmed Mean: Remove extremes then average.